home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / include / stub.h < prev    next >
C/C++ Source or Header  |  1992-04-11  |  2KB  |  46 lines

  1. /* Copyright (c) 1992 The Geometry Center; University of Minnesota
  2.    1300 South Second Street;  Minneapolis, MN  55454, USA;
  3.    
  4. This file is part of geomview/OOGL. geomview/OOGL is free software;
  5. you can redistribute it and/or modify it only under the terms given in
  6. the file COPYING, which you should have received along with this file.
  7. This and other related software may be obtained via anonymous ftp from
  8. geom.umn.edu; email: software@geom.umn.edu. */
  9.  
  10. /* Authors: Charlie Gunn, Stuart Levy, Tamara Munzner, Mark Phillips */
  11.  
  12. #ifndef STUBDEFS
  13. #define STUBDEFS
  14.  
  15. #include "geomclass.h"
  16.  
  17. extern GeomClass *StubMethods();
  18.  
  19. /*
  20.  * This file is #include'd by aspiring per-class stub routines.
  21.  * Each STUBMETHODS() macro creates a Present tag indicating that the
  22.  * corresponding library is not loaded, and a Methods() routine
  23.  * which complains if called.
  24.  * They're useful as components of a libstub.a library used to link with
  25.  * applications that only need a few of the OOGL object-types.
  26.  * Assuming classA, classB, etc. are needed, link as in
  27.  *    -lgeom -lclassA -lclassB ... -lgeom -lstub   -lbbox -l3d -lm
  28.  *
  29.  * Use of the method-specific stubs (e.g. libstubdraw) is quite different;
  30.  * see stubdraw.c.
  31.  */
  32.  
  33. #if defined(__STDC__) || defined(__ANSI_CPP__)
  34.  
  35. #define STUBMETHODS(prefix, meth, lib) \
  36.     int prefix##Present = 0; \
  37.     GeomClass *prefix##Methods() { return StubMethods(meth, lib); }
  38.  
  39. #else /*plain C*/
  40.  
  41. #define    STUBMETHODS(prefix, meth, lib) \
  42.     int prefix/**/Present = 0; \
  43.     GeomClass *prefix/**/Methods() { return StubMethods(meth, lib); }
  44. #endif
  45. #endif
  46.